//
//  BaoxininfoView.m
//  wangzhe
//
//  Created by 李 佳伟 on 2017/11/3.
//  Copyright © 2017年 李 佳伟. All rights reserved.
//

#import "BaoxininfoView.h"

#import "JTCSM.h"

static CGFloat space = 20;
static CGFloat imageSpace = 5;
static CGFloat imagesize = 15;

@implementation BaoxininfoView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (id)initWithFrame:(CGRect)frame title:(NSString *)title content:(NSString *)content imagename:(NSString *)imagename{
    self = [super initWithFrame:frame];
    if (self) {
        
        UILabel *titleLabel = [UILabel initWithFrame:CGRectMake(space, 0, (frame.size.width-2*space-imageSpace-imagesize)/2, frame.size.height) text:title font:15 textAlignment:NSTextAlignmentLeft texcolor:[UIColor blackColor] backgroundColor:nil];
        [self addSubview:titleLabel];
        
        UILabel *contentlable = [UILabel initWithFrame:CGRectMake(KVIEW_X(titleLabel), 0, (frame.size.width-2*space-imageSpace-imagesize)/2, frame.size.height) text:content font:15 textAlignment:NSTextAlignmentRight texcolor:RGBACOLOR(133, 133, 133, 1) backgroundColor:nil];
        [self addSubview:contentlable];
        
        UIImageView *imageview = [[UIImageView alloc]initWithFrame:CGRectMake(KVIEW_X(contentlable)+imageSpace, (frame.size.height-imagesize)/2, imagesize, imagesize)];
        imageview.image = [UIImage imageNamed:imagename];
        [self addSubview:imageview];
        
        [df lineViewWithHeightofTop:frame.size.height superView:self spacing:0 color:RGBACOLOR(241, 241, 241, 241) lineHeight:1];
    }
    
    return self;
}

@end
